package com.fulllife.food.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hswebframework.ezorm.rdb.mapping.annotation.DefaultValue;
import org.hswebframework.web.api.crud.entity.GenericEntity;
import org.hswebframework.web.crud.generator.Generators;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import java.util.Date;

@Table(name = "life_food_benefit")
@Data
public class BenefitEntity extends GenericEntity<String> {

    @Column
    @Schema(description = "好处")
    private String benefit;

    @Column(updatable = false)
    @Schema(description = "创建时间", accessMode = Schema.AccessMode.READ_ONLY)
    @DefaultValue(generator = Generators.CURRENT_TIME)//逻辑默认值
    private Date createTime;

    @Column(updatable = false)
    @Schema(description = "更新时间", accessMode = Schema.AccessMode.READ_ONLY)
    @DefaultValue(generator = Generators.CURRENT_TIME)//逻辑默认值
    private Date updateTime;

}
